#ifndef NUM_ARRAY
#define NUM_ARRAY


#include<string>
#include<iostream>

extern unsigned const MAX_SMALL_NUM;
struct ProxyNum;

struct NumArray {
    friend struct ProxyNum;
    NumArray();
    explicit NumArray(std::string const & num);
    NumArray(unsigned long const & num);
    NumArray(NumArray const & copy);
    ~NumArray();
    NumArray & operator=(NumArray const & right);
    ProxyNum operator[] (size_t index);
    int operator[] (size_t index) const;
    bool isSmall() const;
    size_t size() const;
    void swap(NumArray & right);
    void resize(size_t new_size);
    void normalize();
    friend std::ostream & operator <<(std::ostream & out, NumArray const & number);
private:
    void convertToLargeNum(unsigned long long new_value);
    void convertToSmallNum();
    size_t size_;
    char * number_;
};

std::istream & operator>> (std::istream & in, NumArray & num);

#include"ProxyNum.h"
#endif
